package com.infore.siteManagement.controller.ddic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.entity.StationType;
import com.infore.siteManagement.select.dto.QueryParamDto;
import com.infore.siteManagement.service.IStationTypeService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "站点类型管理接口", tags = {"站点类型管理接口" })
@RestController
@RequestMapping("/stationType")
public class StationTypeController {

	@Autowired
	private IStationTypeService iStationTypeService;
	
	@ApiOperation(value = "查询站点类型通用接口")
	@ResponseBody
	@PostMapping(value = "/query")
	public ResultEntity queryStationType(@RequestBody(required = false) QueryParamDto queryParamDto) {
		return iStationTypeService.queryStationType(queryParamDto);
	}
	
	@ApiOperation(value = "删除站点类型通用接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "站点类型id", name = "ids", paramType = "query",required = true,dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity deleteStationType(String ids) {
		return iStationTypeService.deleteStationType(ids);
	}
	
	@ApiOperation(value = "编辑/新增站点类型通用接口")
	@ResponseBody
	@PostMapping(value = "/edit")
	public ResultEntity editStationType(@RequestBody StationType stationType) {
		return iStationTypeService.editStationType(stationType);
	}
	
	@ApiOperation(value = "验证站点类型通用接口")
	@ResponseBody
	@PostMapping(value = "/validate")
	public ResultEntity validateStationType(@RequestBody StationType stationType) {
		return iStationTypeService.validateStationType(stationType);
	}
}
